package com.server.rule.component.integrated;

import com.server.rule.component.RuleDecision;
import com.shared.rule.TypeDecision;


/**
 * Classe permettant de générer des {@link RuleDecision} à partir d'un {@link TypeDecision}
 * @author queyroi
 *
 */
public class RuleDecisionFactory {

	private static RuleDecisionFactory instance = new RuleDecisionFactory();
	
	private RuleDecisionFactory(){}
	
	public static synchronized RuleDecisionFactory get(){
		return instance;
	}
	
	public RuleDecision createDecision(TypeDecision type){
		switch (type) {
		case MESSAGE:
			return new RuleDecisionMessage();			
		case PRODUIT:
			return new RuleDecisionProduit();			
		default:
			return new RuleDecisionEmptyProposition();
		}
	}
}
